package controllers;

import beans.Slil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import services.impl.SlilServicesImpl;

import javax.servlet.http.HttpServletRequest;
import java.util.List;
import java.util.Map;

@RestController
@RequestMapping("/system")
public class SystemControllers {
    @Autowired
    private SlilServicesImpl slil;

    @RequestMapping("/system_setting")
    public String system() {
        return "index";
    }

    @RequestMapping("/system_log")
    public List systemLog() {
        List<Slil> list = slil.selectList();
        return list;
    }

    @RequestMapping("/searchsystemlog")
    public List<Slil> searchSystemLog(@RequestBody Map<String,String> request) {
        String select=request.get("selectText");
        String input=request.get("inputText");
        List<Slil> list=slil.selectSelective(select,input);
        return list;
    }
    //统计分析
    @RequestMapping("/statistic_analysis")
    public String statisticAnalysis() {
        return "index";
    }

    @RequestMapping("/system_message")
    public String systemMessage() {
        return "index";
    }

}
